3.35 \(\int (b \cos (c+d x))^m (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)) \, dx\)

Optimal. Leaf size=31 \[ \frac {C \sin (c+d x) (b \cos (c+d x))^{m+1}}{b d (m+2)} \]

[Out]

C*(b*cos(d*x+c))^(1+m)*sin(d*x+c)/b/d/(2+m)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.030, Rules used = {3011} \[ \frac {C \sin (c+d x) (b \cos (c+d x))^{m+1}}{b d (m+2)} \]

Antiderivative was successfully verified.

[In]

Int[(b*Cos[c + d*x])^m*(-((C*(1 + m))/(2 + m)) + C*Cos[c + d*x]^2),x]

[Out]

(C*(b*Cos[c + d*x])^(1 + m)*Sin[c + d*x])/(b*d*(2 + m))

Rule 3011

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
 + f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[A*(m + 2) + C*(m +
1), 0]

Rubi steps

\begin {align*} \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx &=\frac {C (b \cos (c+d x))^{1+m} \sin (c+d x)}{b d (2+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.22, size = 113, normalized size = 3.65 \[ \frac {C \sqrt {\sin ^2(c+d x)} \cot (c+d x) (b \cos (c+d x))^m \left ((m+3) \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(c+d x)\right )-(m+2) \cos ^2(c+d x) \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\cos ^2(c+d x)\right )\right )}{d (m+2) (m+3)} \]

Antiderivative was successfully verified.

[In]

Integrate[(b*Cos[c + d*x])^m*(-((C*(1 + m))/(2 + m)) + C*Cos[c + d*x]^2),x]

[Out]

(C*(b*Cos[c + d*x])^m*Cot[c + d*x]*((3 + m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[c + d*x]^2] - (2
+ m)*Cos[c + d*x]^2*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Cos[c + d*x]^2])*Sqrt[Sin[c + d*x]^2])/(d*(2
+ m)*(3 + m))

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 33, normalized size = 1.06 \[ \frac {\left (b \cos \left (d x + c\right )\right )^{m} C \cos \left (d x + c\right ) \sin \left (d x + c\right )}{d m + 2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="fricas")

[Out]

(b*cos(d*x + c))^m*C*cos(d*x + c)*sin(d*x + c)/(d*m + 2*d)

________________________________________________________________________________________

giac [B]  time = 39.96, size = 2494, normalized size = 80.45 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="giac")

[Out]

2*(C*(abs(tan(1/2*d*x + 1/2*c)^2 - 1)*abs(b)/(tan(1/2*d*x + 1/2*c)^2 + 1))^m*tan(-1/4*pi*m*sgn(2*b*tan(1/2*d*x
 + 1/2*c)^4 - 4*b*tan(1/2*d*x + 1/2*c)^2 + 2*b)*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)*sgn(b)*sgn(tan(1/2*d*x + 1/2*c
)) + 1/4*pi*m*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)*sgn(b)*sgn(tan(1/2*d*x + 1/2*c)) + 1/4*pi*m*sgn(tan(1/2*d*x + 1/
2*c)^2 - 1)*sgn(tan(1/2*d*x + 1/2*c)) +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*c)^2 + d*m + 2*d)

________________________________________________________________________________________

maple [F]  time = 2.00, size = 0, normalized size = 0.00 \[ \int \left (b \cos \left (d x +c \right )\right )^{m} \left (-\frac {C \left (1+m \right )}{2+m}+C \left (\cos ^{2}\left (d x +c \right )\right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x)

[Out]

int((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x)

________________________________________________________________________________________

maxima [B]  time = 0.65, size = 175, normalized size = 5.65 \[ -\frac {{\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} C b^{m} \sin \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) - {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} C b^{m} \sin \left (-{\left (d x + c\right )} {\left (m - 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right )}{4 \cdot 2^{m} d {\left (m + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/4*((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*m)*C*b^m*sin(-(d*x + c)*(m + 2)
+ m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x
+ 2*c) + 1)^(1/2*m)*C*b^m*sin(-(d*x + c)*(m - 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(2^m*d*
(m + 2))

________________________________________________________________________________________

mupad [B]  time = 1.01, size = 30, normalized size = 0.97 \[ \frac {C\,\sin \left (2\,c+2\,d\,x\right )\,{\left (b\,\cos \left (c+d\,x\right )\right )}^m}{2\,d\,\left (m+2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*cos(c + d*x))^m*(C*cos(c + d*x)^2 - (C*(m + 1))/(m + 2)),x)

[Out]

(C*sin(2*c + 2*d*x)*(b*cos(c + d*x))^m)/(2*d*(m + 2))

________________________________________________________________________________________

sympy [A]  time = 84.15, size = 279, normalized size = 9.00 \[ \begin {cases} - \frac {2 C \left (- \frac {b \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1} + \frac {b}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1}\right )^{m} \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d m \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d m \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d m + 2 d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d} + \frac {2 C \left (- \frac {b \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1} + \frac {b}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1}\right )^{m} \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d m \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d m \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d m + 2 d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d} & \text {for}\: d \neq 0 \\x \left (b \cos {\relax (c )}\right )^{m} \left (- \frac {C \left (m + 1\right )}{m + 2} + C \cos ^{2}{\relax (c )}\right ) & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*cos(d*x+c))**m*(-C*(1+m)/(2+m)+C*cos(d*x+c)**2),x)

[Out]

Piecewise((-2*C*(-b*tan(c/2 + d*x/2)**2/(tan(c/2 + d*x/2)**2 + 1) + b/(tan(c/2 + d*x/2)**2 + 1))**m*tan(c/2 +
d*x/2)**3/(d*m*tan(c/2 + d*x/2)**4 + 2*d*m*tan(c/2 + d*x/2)**2 + d*m + 2*d*tan(c/2 + d*x/2)**4 + 4*d*tan(c/2 +
 d*x/2)**2 + 2*d) + 2*C*(-b*tan(c/2 + d*x/2)**2/(tan(c/2 + d*x/2)**2 + 1) + b/(tan(c/2 + d*x/2)**2 + 1))**m*ta
n(c/2 + d*x/2)/(d*m*tan(c/2 + d*x/2)**4 + 2*d*m*tan(c/2 + d*x/2)**2 + d*m + 2*d*tan(c/2 + d*x/2)**4 + 4*d*tan(
c/2 + d*x/2)**2 + 2*d), Ne(d, 0)), (x*(b*cos(c))**m*(-C*(m + 1)/(m + 2) + C*cos(c)**2), True))

________________________________________________________________________________________